/*
 * Copyright (c) 2009 XMock contributors
 * This program is made available under the terms of the Apache License.
 */
package org.xmock.controller;

public class MockController {
	
	private static MockController instance;	
	public static enum MockMode {RECORD, PLAY};
	private static boolean[] modeValue = {true, true};
	
	public static MockController getInstance()
	{
		if(instance ==  null)
		{
			instance = new MockController();
		}
		return instance;
	}

	public void enableMockMode(MockMode mockMode)
	{
		modeValue[mockMode.ordinal()] = true;
	}

	public void disableMockMode(MockMode mockMode)
	{
		modeValue[mockMode.ordinal()] = false;
	}

	/**
	 * @return true is mock mode is record
	 */
	public boolean isMockModeRecord() {
		return modeValue[MockMode.RECORD.ordinal()];
	}

	/**
	 * @return true is mock mode is play
	 */
	public boolean isMockModePlay() {
		return modeValue[MockMode.PLAY.ordinal()];
	}
}
